/**
 * Copyright (c) 2017-2024 Nop Platform. All rights reserved.
 * Author: canonical_entropy@163.com
 * Blog:   https://www.zhihu.com/people/canonical-entropy
 * Gitee:  https://gitee.com/canonical-entropy/nop-entropy
 * Github: https://github.com/entropy-cloud/nop-entropy
 */
package com.gitee.wsl.struct.table.impl


class BaseCell() : AbstractCell() {



    override var comment: String? = null

    override var value: Any? = null
        set(value) {
            checkAllowChange()
            field = value
        }

    override var mergeAcross: Int = 0

    override var mergeDown: Int = 0

    protected fun copyTo(cell: BaseCell) {
        super.copyTo(cell)
        cell.value = value
        cell.comment = comment
        cell.mergeAcross = mergeAcross
        cell.mergeDown = mergeDown
    }

    override val formula: String?
        get() = null

   /* protected fun outputJson(out: IJsonHandler) {
        super.outputJson(out)
        if (isProxyCell) {
            out.put("proxy", true)
        } else {
            if (value != null) out.put("value", value)
            if (comment != null) out.put("comment", comment)
            if (mergeAcross > 0) out.put("mergeAcross", mergeAcross)
            if (mergeDown > 0) out.put("mergeDown", mergeDown)
        }
    }*/

    override fun cloneInstance(): BaseCell {
        val ret = BaseCell()
        copyTo(ret)
        return ret
    }
}